//
//  CharListViewCell.m
//  Gunz
//
//  Created by Joggy on 16/3/9.
//  Copyright © 2016年 NUPT. All rights reserved.
//

#import "ChatListViewCell.h"
#import "Files.h"

@implementation ChatListViewCell

const CGFloat cellHeight = 89;

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    self.frame = CGRectMake(0, 0, screenWidth, cellHeight);
    _headImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, CLHeadImageWidth, CLHeadImageWidth)];
    _headImageView.image = [GZImage iconPlaceHolderImage];
    _headImageView.layer.position = CGPointMake(CLHeadImageToLeft + CLHeadImageWidth/2, cellHeight/2);
    [self.contentView addSubview:_headImageView];
    _chatTarget = [[UILabel alloc] initWithFrame:CGRectMake(_headImageView.frame.origin.x + _headImageView.frame.size.width + CLTargetToLeft, _headImageView.frame.origin.y, self.frame.size.width*0.7, [GZFont getCellTitleFont])];
    _chatTarget.font = [UIFont systemFontOfSize:[GZFont getCellTitleFont]];
    _chatTarget.textColor = [GZColor getCellTitleColor];
    _chatTarget.numberOfLines = 1;
    [self.contentView addSubview:_chatTarget];
    _lastMassage = [[UILabel alloc] initWithFrame:CGRectMake(_headImageView.frame.origin.x + _headImageView.frame.size.width + CLTargetToLeft, _headImageView.layer.position.y, self.frame.size.width*0.7, [GZFont getCellDetailFont])];
    _lastMassage.font = [UIFont systemFontOfSize:[GZFont getCellDetailFont]];
    _lastMassage.textColor = [GZColor getCellDetailColor];
    _lastMassage.numberOfLines = 2;
    [self.contentView addSubview:_lastMassage];
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
